We have a mobile app for you to download and use. And you can unlock many features in the app.
class Brain { constructor() { this.name = "Nameless Bot"; this.color = "purple"; this.armor = 0; this.scanDistance = 0; this.bulletPower = 0; // decide() should change these 2 this.decision = "shoot"; this.shotAngle = 0; /* you can add additional variables here if you want */ } /* these calls are available any time and do NOT take the place of a decision this.scan(); will either return: 1. an object with the enemy's x and y (if an enemy is within the scan radius) 2. an empty object (if no enemy within the radius) this.whereAmI(); will return your x and y in an object (ex: {x: 25, y: 61}) */ // the decide call gets made // every time the game updates // (e.g. every 100ms) decide() { // decision-making logic here // (e.g., move left, shoot, etc.) return this.decision; } }
export default class MyBrain { constructor() { this.name = "Big Brain Bot"; this.color = "purple"; this.armor = 0; this.scanDistance = 0; this.bulletPower = 0; // decide() should change these 2 this.decision = "shoot"; this.shotAngle = 0; /* you can add additional variables here if you want */ } /* these calls are available any time and do NOT take the place of a decision this.scan(); will either return: 1. an object with the enemy's x and y (if an enemy is within the scan radius) 2. an empty object (if no enemy within the radius) this.whereAmI(); will return your x and y in an object (ex: {x: 25, y: 61}) */ // the decide call gets made // every time the game updates // (e.g. every 100ms) decide() { // decision-making logic here // (e.g., move left, shoot, etc.) return this.decision; } }
${pres[i].innerHTML}